package cn.swing.learning;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Desc : TODO
 * ClassName : cn.swing.learning.TestTimer
 *
 * @author : 林鹏群
 * @date : 2022/12/23 15:00
 */
public class TestTimer {

    public static void main(String[] args) {

        JFrame jFrame = new JFrame();
        jFrame.setVisible(true);

        ActionListener actionListener = new ActionListener(){
            int i = 0;
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println(i++);
            }
        };

        Timer timer = new Timer(500,actionListener);

        timer.start();
    }
}
